clc;clear;close all;
%% 生成图片的参数
%=========================  Default     ===================================
I_rows = 500;   %行像素数
I_cols = 500;   %列像素数
A = 0.5;        %光强
B1 = 0;         %谐波
nm = 0;         %噪声均值
gamma = 1;      %非线性
pst = 0;        %倾斜相移
%=========================  Simulink1   ===================================
% 仿真实验1
%   目的：为了探究不同B值下，算法的优势程度
%   对照组数量：8组
%   对照参数：B = linspace(50, 120, 8)/256;
% N = 6;              %F步相移
% T = 50;             %一个周期像素数
% freq = I_cols / T;  %根据周期计算频率
% ps = zeros(1,N);    %未知相移
% B = linspace(90, 125, 8)/256;
% ni = linspace(6, 36, N)/256;
% % ni = zeros(1,N);
% W = 1./(ni.^2);W = W./sum(W);
% for i = 1:length(B)
%     filepath = ['Simulink/Simulink (1)/Figure (',int2str(i),')/'];
%     save([filepath,'ni.mat'],"ni");
%     fun_createFigure(N, A, B(i), B1, freq, I_rows, I_cols, ni, nm, gamma, ps, pst, filepath);
% end
%=========================  Simulink2   ===================================
% 仿真实验2
%   目的：为了探究不同N值下，算法的优势程度
%   对照组数量：8组
%   对照参数：F = linspace(3, 10, 8);
% T = 50;             %一个周期像素数
% freq = I_cols / T;  %根据周期计算频率
% B = 125/256;
% N = linspace(3, 10, 8);
% for i = 1:length(N)
%     ni = linspace(6, 36, N(i))./256;
%     ps = zeros(1,N(i));    %未知相移
%     filepath = ['Simulink/Simulink (2)/Figure (',int2str(i),')/'];
%     save([filepath,'ni.mat'],"ni");
%     fun_createFigure(N(i), A, B, B1, freq, I_rows, I_cols, ni, nm, gamma, ps, pst, filepath);
% end
%=========================  Simulink3   ===================================
% 仿真实验3
%   目的：为了探究不同T值下，算法的优势程度
%   对照组数量：8组
%   对照参数：T = [10 20 25 50 100 125 250 500];
N = 6;              %F步相移
B = 125/256;
ps = zeros(1,N);    %未知相移
ni = linspace(6, 36, N)/256;
freq = linspace(6, 13, 8);
for i = 1:length(freq)
    filepath = ['Simulink/Simulink (3)/Figure (',int2str(i),')/'];
    save([filepath,'ni.mat'],"ni");
    fun_createFigure(N, A, B, B1, freq(i), I_rows, I_cols, ni, nm, gamma, ps, pst, filepath);
end
%=========================  Simulink4   ===================================
% 仿真实验4
%   目的：为了探究不同尺寸下，算法的优势程度
%   对照组数量：8组
%   对照参数：S = [200 300 400 500 600 700 800 900];
N = 6;              %F步相移
B = 125/256;
ps = zeros(1,N);    %未知相移
ni = linspace(6, 36, N)/256;
freq = 10;
S = linspace(200,900,8);
for i = 1:length(S)
    I_rows = S(i);
    I_cols = S(i);
    filepath = ['Simulink/Simulink (4)/Figure (',int2str(i),')/'];
    save([filepath,'ni.mat'],"ni");
    fun_createFigure(N, A, B, B1, freq, I_rows, I_cols, ni, nm, gamma, ps, pst, filepath);
end
